package com.love.rongapi.task;

import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.stereotype.Component;

@Component
@Configuration
@EnableScheduling
public class ScheduleTask {
//    @Resource
//    private QuestionService questionService;

    //3.添加定时任务
//    @Scheduled(cron = "0/2 * * * * ?")
//    private void configureTasks() {
//        ThreadUtil.execAsync(() -> {
//            try {
//                questionService.getQuestion();
//            } catch (Exception e) {
//
//            }
//        });
//    }


    //3.添加定时任务
//    @Scheduled(cron = "0/5 * * * * ?")
//    private void configureTasks1() {
//        ThreadUtil.execAsync(() -> {
//            try {
//                questionService.getQuestion(1);
//            } catch (Exception e) {
//
//            }
//        });
//    }
}
